package com.boc.address.http;

import com.boc.address.bean.AddressListBean;

import java.util.List;

import demo.bocweb.com.sdk.base.bean.BaseBean;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST;

/**
 * 地址相关api
 * Created by zhelun on 2018/2/2.
 */

public interface AddressApi {
    /**
     * 获取收货地址
     *
     * @return
     */
    @GET(AddressUrl.addressList)
    Observable<BaseBean<List<AddressListBean>>> getAddressList();

    /**
     * 添加收货地址
     *
     * @param body
     * @return
     */
    @POST(AddressUrl.addAddress)
    Observable<BaseBean> addAddress(@Body RequestBody body);

    /**
     * 设置默认地址
     *
     * @param body
     * @return
     */
    @POST(AddressUrl.setDefaultAddress)
    Observable<BaseBean> setDefault(@Body RequestBody body);


    /**
     * 删除收货地址
     *
     * @param requestBody
     * @return
     */
    @HTTP(method = "DELETE", path = AddressUrl.deleteAddress, hasBody = true)
    Observable<BaseBean> delete(@Body RequestBody requestBody);



}
